#include "XTools.h"
#ifdef _WIN32
#include <io.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <string>

using namespace std;

XCOM_API std::string getDirData(string path)
{
    string data;
#ifdef _WIN32
    _finddata_t fileInfo;
    string fileName = path + "\\*.*";
    intptr_t handle = _findfirst(fileName.c_str(), &fileInfo);
    if (handle == -1)
        return data;
    do
    {
        if (strcmp(fileInfo.name, ".") != 0 && strcmp(fileInfo.name, "..") != 0)
        {
            data += fileInfo.name;
            data += ",";
            data += "\n";
            data += ",";
        }
    } while (_findnext(handle, &fileInfo) == 0);
#else

#endif
    return data;
}
namespace xplatform
{
    std::string GetDirData(const std::string &path)
    {
        return std::string();
    }
}